﻿Ext.define("App.View.Socios.Forms", {
    extend: "App.Config.Abstract.Form",
    title: "",
    botones: false,
    columns: 2,
    icono : '',
    EventosForm : null,
    scope : null,
    initComponent: function () {
        var me = this;
        if (me.opcion == "FormImagen") {
            me.CargarFormImagen();

        }
        else if (me.opcion == 'formResumen') {
            me.title = "Resumen";
            me.CargarFormResumen();
        }
        this.callParent(arguments);
    },
    CargarFormImagen: function () {
        var me = this;
        me.scope = me.scope == null ? this : me.scope;
        var changingImage = Ext.create('Ext.Img', {
//            width : 240,
//            height : 100,
            colspan : 2,
            src: 'http://localhost/extjs/extjs/docs/images/Ext.Img/Ext.Img.png',
//            renderTo: Ext.getBody()
        });
        var buttonCrear = Funciones.CrearMenu('btn_Crear_imagen', 'Crear Socio', 'image_add', me.EventosForm, null, me.scope);
        var buttonVer = Funciones.CrearMenu('btn_Ver_imagen', 'Ver Imagen', 'image_link', me.EventosForm, null, me.scope);

        me.items = [
        changingImage ,
        buttonCrear,
        buttonVer
        ];
    },
//    EventosForm : function(btn)
//    {
//        var me = this;
//        switch (btn.getItemId()) {
//            case "btn_Crear_imagen":
//                me.BotonesSocio(false);
//                break;
//            default:
//                Ext.Msg.alert("Aviso", "No Existe el botton");
//        }
//    },
    CargarFormResumen: function () {
        var me = this;
        var label1 = Ext.create("Ext.form.Label", {
            text: 'LITROS',
            cls : 'resaltarAzulRight',

        });
        var label2 = Ext.create("Ext.form.Label", {
            text: 'P-COSTO',
            cls : 'resaltarAzul',
        });
        var label3 = Ext.create("Ext.form.Label", {
            text: 'P-VENTA',
            cls : 'resaltarAzul',
        });
        me.txt_diesel = Ext.create("App.Config.Componente.TextFieldBase", {
            fieldLabel: "Diesel",
            name: "COD_POSTE",
            width: 180,
            colspan: 1,
            emptyText: ''
        });
        me.txt_diesel_costo = Ext.create("App.Config.Componente.TextFieldBase", {
            fieldLabel: "",
            name: "COD_POSTE",
            width: 70,
            colspan: 1,
            emptyText: ''
        });
        me.txt_diesel_venta = Ext.create("App.Config.Componente.TextFieldBase", {
            fieldLabel: "",
            name: "COD_POSTE",
            width: 70,
            colspan: 1,
            emptyText: ''
        });
        me.txt_gasolina = Ext.create("App.Config.Componente.TextFieldBase", {
            fieldLabel: "Gasolina",
            name: "AREA_UBIC",
            width: 180,
            emptyText: '',
            colspan: 1
        });
        me.txt_gasolina_costo = Ext.create("App.Config.Componente.TextFieldBase", {
            fieldLabel: "",
            name: "AREA_UBIC",
            width: 70,
            colspan: 1,
            emptyText: ''
        });
        me.txt_gasolina_venta = Ext.create("App.Config.Componente.TextFieldBase", {
            fieldLabel: "",
            name: "AREA_UBIC",
            width: 70,
            colspan: 1,
            emptyText: ''
        });

        me.items = [
        label1,
        label2,
        label3,
        me.txt_diesel,
        me.txt_diesel_costo,
        me.txt_diesel_venta,
        me.txt_gasolina,
        me.txt_gasolina_costo,
        me.txt_gasolina_venta
        ];
    }
});
